package com.cumt.server.provider.home;

import com.cumt.entity.User;
import com.cumt.framework.dubbo.impl.DubboBaseInterfaceImpl;
import com.cumt.framework.exception.DubboProviderException;
import com.cumt.framework.mapper.BaseInterfaceMapper;
import com.cumt.provider.UserProvider;
import com.cumt.server.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.core.io.Resource;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by caicf on 2016/12/27.
 */
public class UserProviderImpl extends DubboBaseInterfaceImpl<User> implements UserProvider {

    @Autowired
    @Qualifier("userMapper")
    private UserMapper userMapper;

    @Override
    protected BaseInterfaceMapper getBaseInterfaceMapper() {
        return userMapper;
    }


    @Override
    public String sayHello(String str) throws DubboProviderException {
        try {

            User user = new User();
            user.setName("sfdasdf");
            userMapper.save(user);
//            throw new RuntimeException("sdfds");
        } catch (Exception e) {
        }
//        throw new DubboProviderException("");
        return "ss";
    }
}
